﻿<%@ Page MasterPageFile="~/Layout/Site.Master" Language="C#" AutoEventWireup="true"
    CodeBehind="Bets.aspx.cs" Inherits="WebRole1.Bets" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="BetsContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <ul class="form">
        <li>
            <label>
                Person:
            </label>
            <asp:DropDownList ID="_person" runat="server" AutoPostBack="true" />
        </li>
        <li>
            <asp:HiddenField ID="_id" runat="server" />
            <label>
                Event:
            </label>
            <asp:TextBox ID="_event" runat="server" />
        </li>
        <li>
            <label>
                Amount:
            </label>
            <asp:TextBox ID="_value" runat="server" />
        </li>
        <li>
            <asp:Button ID="save" runat="server" Text="Save" OnClick="Save_Click" />
        </li>
    </ul>
    <br />
    <asp:GridView ID="BetList" runat="server" AutoGenerateColumns="False" OnRowDeleting="BetList_RowDeleting"
        OnSelectedIndexChanging="BetList_SelectedIndexChanging" CellPadding="4" ForeColor="#333333"
        GridLines="None">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:CommandField ShowDeleteButton="true" ShowSelectButton="true" HeaderText="Actions" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HiddenField ID="id" runat="server" Value='<%# Eval("id") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="event" HeaderText="Event" />
            <asp:BoundField DataField="value" HeaderText="Amount" />
        </Columns>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>
    <%-- Validators --%>
    <asp:RequiredFieldValidator ID="ReqVal_Person" runat="server" ErrorMessage="<strong>Required Field</strong><p>Please select a Person.</p>"
        ControlToValidate="_person" Display="None" SetFocusOnError="true" />
    <asp:RequiredFieldValidator ID="ReqVal_Event" runat="server" ErrorMessage="<strong>Required Field</strong><p>Please enter an Event name.</p>"
        ControlToValidate="_event" Display="None" SetFocusOnError="true" />
    <asp:RequiredFieldValidator ID="ReqVal_Value" runat="server" ErrorMessage="<strong>Required Field</strong><p>Please enter the Amount owed.</p>"
        ControlToValidate="_value" Display="None" SetFocusOnError="true" />
    <%-- AJAX --%>
    <cc1:ValidatorCalloutExtender ID="ReqValPop_Person" runat="server" TargetControlID="ReqVal_Person"
        Width="300" />
    <cc1:ValidatorCalloutExtender ID="ReqValPop_Event" runat="server" TargetControlID="ReqVal_Event"
        Width="300" />
    <cc1:ValidatorCalloutExtender ID="ReqValPop_Value" runat="server" TargetControlID="ReqVal_Value"
        Width="300" />
</asp:Content>
